package com.firmboy.proxy.jdk;

import org.junit.Test;

/**
 * 代理测试
 *
 * @author firmboy
 * @create 2018-05-06 下午7:35
 **/
public class ProxyTest {

    @Test
    public void proxyTest(){

        UserServiceImpl userService = new UserServiceImpl();

        MyInvocationHandler handler = new MyInvocationHandler(userService);

        Object proxy = handler.getProxy();

        UserService service = (UserService)proxy;

        service.add();


    }

}
